package org.jeecg.modules.wangge;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.http.Header;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.ocr.OcrCtrl;
import org.jeecg.modules.pucheng.dto.ListDataDto;
import org.jeecg.modules.pucheng.entity.WgEvent;
import org.jeecg.modules.pucheng.entity.WgEventFile;
import org.jeecg.modules.pucheng.service.IWgEventFileService;
import org.jeecg.modules.pucheng.service.IWgEventService;
import org.jeecg.modules.pucheng.vo.ArrListVo;
import org.jeecg.modules.pucheng.vo.ToDoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import java.io.*;
import java.net.HttpCookie;
import java.text.SimpleDateFormat;
import java.util.*;

@Slf4j
@RestController
@RequestMapping("/datapull")
@Api(tags = "网格化数据同步离线抓取")
public class DataPullController {

    @Value(value = "${jeecg.path.upload}")
    private String uploadpath;

    @Autowired
    private OcrCtrl ocrCtrl;
    @Autowired
    private IWgEventService wgEventService;
    @Autowired
    private IWgEventFileService wgEventFileService;

    //    @ApiOperation("获取验证码")
    @RequestMapping(value = "/getCode", method = RequestMethod.GET)
    private Result<Object> getCode() {
//        String url = "http://59.204.145.208:10000/servlet/validateCode.spng?t=0.9903605880758632";
//        Map<String, String> header = new HashMap<>();
//        header.put("Accept", "image/webp,image/apng,image/*,*/*;q=0.8");
//        header.put("Accept-Encoding", "gzip, deflate");
//        header.put("Accept-Language", "zh-CN,zh;q=0.9");
//        header.put("Connection", " keep-alive");
//        //Cookie: Secure; Secure; loginName=nphuanght; loginPwd=Pchbj12369; JSESSIONID=3A14E18837BA3734F3CBFC3A5650AC4F; UAM_SESSIONID=AA9FECE4B2AE0F25451C95B8E501FBC2
//        header.put("Host", "59.204.145.208:10000");
//        header.put("Referer", "http://59.204.145.208:10000/npLogin");
//        header.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36");
//        Map<String, Object> param = new HashMap<>();
//        param.put("t", 0.9903605880758632);
//        HttpResponse response = HttpRequest.get(url).addHeaders(header).execute();
        //String resultStr = response.body();
        //{"code":200,"desc":"成功","data":{"id":null,"areaid":null,"pid":null,"account":null,"password":null,"displayName":null,"perfScore":null,"qrcodeId":null,"email":null,"userAuthType":null,"mobile":null,"address":null,"company":null,"isLogined":null,"mobileType":null,"directCounty":null,"createTime":null,"qq":null,"towmid":null,"villageid":null,"groupSort":null,"facePicture":null,"isOpenFace":null,"isEnableFace":null,"xmaintPatro":null,"maintId":null,"indexNo":null,"job":null,"scodeno":null,"enabled":null,"codeId":"admin_login_auth_custom_dc555488539f46e4bcfff1decd1d9182","authCode":"r7uc","clientType":null}}
        //JSONObject jsonObject = JSONObject.fromObject(resultStr);
        try {
//            JSONObject json = jsonObject.getJSONObject("data");
//            String codeId = json.getString("codeId");
//            String authCode = json.getString("authCode");
//            LzCode lzCode = new LzCode();
//            lzCode.setAuthCode(authCode);
//            lzCode.setCodeId(codeId);
//            return Result.ok(lzCode);


//            URL url = new URL("http://59.204.145.208:10000/servlet/validateCode.spng?t=0.7293091255670676");
//            HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
//            //需要设置头信息，否则会被识别为机器而获取不到验证码图片
//            conn.setRequestProperty("Accept", "image/webp,image/apng,image/*,*/*;q=0.8");
//            conn.setRequestProperty("Accept-Encoding", "gzip, deflate");
//            conn.setRequestProperty(" Accept-Language", "zh-CN,zh;q=0.9");
//            conn.setRequestProperty("Connection", "keep-alive");
//            conn.setRequestProperty("Cookie", "Secure; loginName=nphuanght; loginPwd=Pchbj12369; remember=remember; Secure; UAM_SESSIONID=11B4C1A7FC000A33D63651A5BAF68814");
//            conn.setRequestProperty("Host", "59.204.145.208:10000");
//            conn.setRequestProperty("Referer", "http://59.204.145.208:10000/?token=3yMFbsBrg5xKlebk2BM9pA%2BdYWbwxGUV8dHmBrxNrF%2FGNXSHbVHC5QSyuIWB4nQFOPg7s3gMcc6LyKsLeXuHkMUoZCi%2FRoqiB08r%2Fn%2BGX4m%2FpDzJ%2FV%2BKq%2FhpYZHSCwPYCDfegeVlJV1PjsyONXHXGXSdPGy59CNJ5jTzsQdj0lE%3D");
//            conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36");
//            conn.connect();

//            HttpClient httpclient = new DefaultHttpClient();// 创建默认http连接
//            HttpGet get = new HttpGet("http://59.204.145.208:10000/servlet/validateCode.spng?t=0.7293091255670676");// 创建一个get请求
//            org.apache.http.HttpResponse response = httpclient.execute(get);// 用http连接去执行get请求并且获得http响应
//
//            HttpEntity entity = response.getEntity();// 从response中取到响实体


//            File f = new File("E:\\doc\\test.png");
//            OutputStream out = new FileOutputStream(f);//如果文件不存在会自动创建
//            entity.writeTo(out);
//            out.flush();
//            out.close();

//
//            int result = -1;
//            byte[] buf = new byte[1024];
//            BufferedInputStream bis = new BufferedInputStream(entity.getContent());
//            FileOutputStream fos = new FileOutputStream("E:\\doc\\test.png");
//            while ((result = bis.read(buf)) != -1) {
//                fos.write(buf);
//            }
//            fos.flush();
//
//            fos.close();
//            bis.close();
//            System.out.println("图片下载成功");
        } catch (Exception e) {
            return Result.error("获取验证码失败");
        }
        return Result.ok();
    }

    private Map<String, String> getHeader() {
        Map<String, String> header = new HashMap<>();
        try {
            header.put("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3");
            header.put("Accept-Encoding", "gzip, deflate");
            header.put("Accept-Language", "zh-CN,zh;q=0.9");
            header.put("Connection", "keep-alive");
            header.put("Cache-Control", "max-age=0");
            header.put("Upgrade-Insecure-Requests", "1");
            header.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36");
            header.put("Cookie", "loginName=nphuanght; loginPwd=Pchbj12369; Secure; JSESSIONID=600EF624AB6C0B7CDF94AFE46A588137; UAM_SESSIONID=4B6C3D91FB02CB5F51E4B0A38C14F992; remember=remember");
            HttpResponse response = HttpRequest.get("http://59.204.145.208:10000/?token=3yMFbsBrg5xKlebk2BM9pA%2BdYWbwxGUV8dHmBrxNrF%2FGNXSHbVHC5QSyuIWB4nQFOPg7s3gMcc6LyKsLeXuHkMUoZCi%2FRoqiB08r%2Fn%2BGX4m%2FpDzJ%2FV%2BKq%2FhpYZHSCwPYCDfegeVlJV1PjsyONXHXGXSdPGy59CNJ5jTzsQdj0lE%3D").addHeaders(header).execute();
            header.put("Accept", "*/*");
            List<HttpCookie> cookies = response.getCookies();
            String uam = "";
            if (cookies.size() > 0) {
                uam = cookies.get(0).getValue();
            }
            String old = header.get("Cookie");
            old = old.replace("4B6C3D91FB02CB5F51E4B0A38C14F992", uam);
            old += " ;5ca4e853f4923cb2a8ccab6476447663=c248af36-2331-482e-bdc4-15c038fc307d";
            //header.put("Content-Length","0");
            header.put("Cookie", old);
            header.put("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
            header.put("Host", "59.204.145.208:10000");
            header.put("Origin", "http://59.204.145.208:10000");
            header.put("Referer", "http://59.204.145.208:10000/?token=3yMFbsBrg5xKlebk2BM9pA%2BdYWbwxGUV8dHmBrxNrF%2FGNXSHbVHC5QSyuIWB4nQFOPg7s3gMcc6LyKsLeXuHkMUoZCi%2FRoqiB08r%2Fn%2BGX4m%2FpDzJ%2FV%2BKq%2FhpYZHSCwPYCDfegeVlJV1PjsyONXHXGXSdPGy59CNJ5jTzsQdj0lE%3D");
            //header.put("Sec-Fetch-Mode","cors");
            //header.put("Sec-Fetch-Site","cross-site");

            header.put("X-Requested-With", "XMLHttpRequest");
        } catch (Exception e) {
            throw new JeecgBootException("获取cookie失败");
        }
        return header;
    }


    //@ApiOperation("网格化登录")
    @RequestMapping(value = "/login", method = RequestMethod.GET)
    public Result<Object> loginSystem() {
        //?&time=0.5678453169367936
        //Cookie: Secure; 5ca4e853f4923cb2a8ccab6476447663=f840a168-5513-4ca9-8625-06bd0f6dc0af; ace.settings=%7B%22sidebar-collapsed%22%3A-1%7D; Secure; loginPwd=Pchbj12369; loginName=nphuanght; JSESSIONID=B8F53975DDAE20D49335AFA80E191607; UAM_SESSIONID=F86D758BED026908DF4DFF596B74B058
        Map<String, Object> param = new HashMap<>();
        param.put("loginName", "nphuanght");
        param.put("loginPwd", "53d88d9c57237f5bc37fadf7faea2376");
//        param.put("loginType", null);
        param.put("redirectUrl", null);
        JSONObject jsonObject = null;
        Map<String, String> header = getHeader();
        for (int i = 0; i < 10; i++) {
            double random = Math.random();
            String downURL = "http://59.204.145.208:10000/servlet/validateCode.spng?t=" + random;
            String url = "http://59.204.145.208:10000/admin/loginCheck?&time=" + Math.random();
            Result<?> result = ocrCtrl.readUntilCode(downURL, "");
            String code = "";
            if (result.getCode() == 200) {
                Map<String, String> map = (Map<String, String>) result.getResult();
                code = map.get("code");
            }
            param.put("code", code);
            param.put("t", random);
            HttpResponse response = HttpRequest.post(url).header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded;charset=UTF-8").addHeaders(header).form(param).execute();
            String resultStr = response.body();
            if ("Error request, response status: 404".equals(resultStr)) {
                continue;
            } else if ("2".equals(resultStr)) {
                continue;
            } else if ("3".equals(resultStr)) {
                continue;
            } else {
                return Result.ok("ok");
            }

        }
        return Result.ok(jsonObject);
    }

    //    @ApiOperation("选择组织")
    @RequestMapping(value = "/selectOrg/{type}", method = RequestMethod.GET)
    public Result<?> selectOrg(@PathVariable int type) {
        String text1 = "";
        String text2 = "";
        String text3 = "";
        if (type == 1) {
            text1 = "1500";
            text3 = "350707";
        } else {
            text1 = "433696";
            text3 = "350707C30";
        }
        String url = "http://59.204.145.208:10000/admin/switchByOrg?orgId=" + text1 + "&positionId=" + text2 + "&orgCode=" + text3;
        Map<String, String> header = getHeader();
        HttpResponse response = HttpRequest.post(url).header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded;charset=UTF-8").addHeaders(header).execute();
        return Result.ok();
    }

//    @ApiOperation("获取数据")
    @RequestMapping(value = "/listData", method = RequestMethod.POST)
    public Result<?> listData(@RequestBody ListDataDto dto) {
        String eventType = "";
        String eInfoOrgCode = "";
        switch (dto.getType()) {
            case 1:
                eventType = "todo";  //待办事件
                break;
            case 2:
                eventType = "done";  //经办事件
                break;
            case 3:
                eventType = "history"; //归档事件
                eInfoOrgCode = "MzUwNzA3";
                break;
            case 4:
                eInfoOrgCode = "MzUwNzA3";
                eventType = "all";  // 辖区事件
                break;
            case 5:
                eventType = "my"; //我发起的
                break;
            default:
                eventType = "";
                break;
        }

        String url = "http://59.204.145.208:10001/zhsq_event/zhsq/event/eventDisposalController/listData.json";
        Map<String, String> header = new HashMap<>();
        header.put("Accept", "application/json, text/javascript, */*; q=0.01");
        header.put("Accept-Encoding", "gzip, deflate");
        header.put("Accept-Language", "zh-CN,zh;q=0.9");
        header.put("Connection", "keep-alive");
        header.put("Content-Type", "application/x-www-form-urlencoded");
        header.put("Host", "59.204.145.208:10001");
        header.put("Cookie", dto.getCookie().toString());
        header.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36");
        header.put("X-Requested-With", "XMLHttpRequest");
        Map<String, Object> param = new HashMap<>();
        param.put("isRemoveTypes", "");
        param.put("eventType", eventType);
        param.put("typesForList", "");
        param.put("orderByField", "");  //T1.CREATE_TIME ASC T1.CREATE_TIME DESC            T1.HAPPEN_TIME ASC   T1.HAPPEN_TIME DESC
        param.put("taskReceivedStaus", ""); // 是否接收  1 已接收 0 未接受
        param.put("eventAttrTrigger", "");
        param.put("eInfoOrgCode", eInfoOrgCode);
        param.put("page", dto.getPage());
        param.put("rows", dto.getRows());
        HttpResponse response = HttpRequest.post(url).header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded").addHeaders(header).form(param).execute();
//        Cookie:
//        EVENT_SESSIONID = ED2576D541D49C25ACE06821F22C97C9;
//        loginName = nphuanght;
//        loginPwd = Pchbj12369;
//        Secure;
//        remember = remember;
//        UAM_SESSIONID = 966D AF978F431D11EF75AE9329557F3D;
//        UAM_TOKEN_FLAG = 0;
//        resourcekey = "V6q72kt3G3uF1cB8pbKvg8rIo4k9n6FlCwKWlaBnQ7oClK+VAe91dZYokmCMJaPJ/ZlGwmK0TB9GMWPhmPMCZA==";
//        resource = MPIFDMlak4msTkC9jLOy7cIA3IubfmEyxqRRmhKP / 1 iSV5ulMCHLB49V8CZvq0bA;
//        JSESSIONID = 8 C94DB4030CD565F7368C9BB1DD18BC6;
//        SYS_SESSIONID = 41323F 74748 BF996B32889F1F9BA0CA5

        //待办
        //{"total":2020,"rows":[{"taskReceivedStaus":"1","happenTimeStr":"2019-10-29 15:14:25","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡北山村人居环境整治","ROWNUM_":1,"instanceId":21650324,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡北山村人居环境整治","handleDate":1573197435000,"createTimeStr":"2019-10-29 15:17:15","happenTime":1572333265000,"eventId":647448,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-08 15:17:15","supervisionType":"0","workFlowId":5053100,"createTime":1572333435000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21650357,"status":"03"},{"taskReceivedStaus":"1","happenTimeStr":"2019-10-29 15:13:38","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡深坑村人居环境整治","ROWNUM_":2,"instanceId":21650082,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡深坑村人居环境整治","handleDate":1573197387000,"createTimeStr":"2019-10-29 15:16:28","happenTime":1572333218000,"eventId":647441,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-08 15:16:27","supervisionType":"0","workFlowId":5053100,"createTime":1572333388000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21650115,"status":"03"},{"happenTimeStr":"2019-10-29 15:12:45","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡秀里村人居环境整治","ROWNUM_":3,"instanceId":21649869,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡秀里村人居环境整治","handleDate":1573197335000,"createTimeStr":"2019-10-29 15:15:35","happenTime":1572333165000,"eventId":647435,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-08 15:15:35","supervisionType":"0","workFlowId":5053100,"createTime":1572333335000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21649902,"status":"03"},{"happenTimeStr":"2019-10-29 15:11:43","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡均溪村人居环境整治广告牌清理","ROWNUM_":4,"instanceId":21649729,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡均溪村人居环境整治","handleDate":1573197272000,"createTimeStr":"2019-10-29 15:14:33","happenTime":1572333103000,"eventId":647431,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-08 15:14:32","supervisionType":"0","workFlowId":5053100,"createTime":1572333273000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21649762,"status":"03"},{"happenTimeStr":"2019-10-29 15:10:04","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"刘田村召开村民代表大会，研究部署人居环境整治，乡村振兴，","ROWNUM_":5,"instanceId":21649375,"handleDateFlag":"1","statusName":"结案待评","eventName":"刘田村召开村民代表大会，研究部署人居环境整治，乡村振兴，","handleDate":1573197174000,"createTimeStr":"2019-10-29 15:12:54","happenTime":1572333004000,"eventId":647421,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-08 15:12:54","supervisionType":"0","workFlowId":5053100,"createTime":1572333174000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21649408,"status":"03"},{"happenTimeStr":"2019-10-29 15:09:05","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡深坑村人居环境清理","ROWNUM_":6,"instanceId":21649156,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡深坑村人居环境清理","handleDate":1573197115000,"createTimeStr":"2019-10-29 15:11:55","happenTime":1572332945000,"eventId":647415,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-08 15:11:55","supervisionType":"0","workFlowId":5053100,"createTime":1572333115000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21649192,"status":"03"},{"happenTimeStr":"2019-10-29 15:08:30","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡深坑村人居环境清理","ROWNUM_":7,"instanceId":21649081,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡深坑村人居环境清理","handleDate":1573197079000,"createTimeStr":"2019-10-29 15:11:20","happenTime":1572332910000,"eventId":647413,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-08 15:11:19","supervisionType":"0","workFlowId":5053100,"createTime":1572333080000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21649114,"status":"03"},{"happenTimeStr":"2019-10-29 15:06:36","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡庙湾村人居环境清理","ROWNUM_":8,"instanceId":21648820,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡庙湾村人居环境清理","handleDate":1573197025000,"createTimeStr":"2019-10-29 15:10:25","happenTime":1572332796000,"eventId":647405,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-08 15:10:25","supervisionType":"0","workFlowId":5053100,"createTime":1572333025000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21648853,"status":"03"},{"happenTimeStr":"2019-10-29 15:05:48","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"组织县交通执法、乡、村人员到东峰村进行人居环境整治。","ROWNUM_":9,"instanceId":21648578,"handleDateFlag":"1","statusName":"结案待评","eventName":"组织县交通执法、乡、村人员到东峰村进行人居环境整治。","handleDate":1573196917000,"createTimeStr":"2019-10-29 15:08:38","happenTime":1572332748000,"eventId":647398,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-08 15:08:37","supervisionType":"0","workFlowId":5053100,"createTime":1572332918000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21648611,"status":"03"},{"happenTimeStr":"2019-10-29 15:04:29","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡主席到刘田垄冲坞检查环境卫生","ROWNUM_":10,"instanceId":21648371,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡主席到刘田垄冲坞检查环境卫生","handleDate":1573196839000,"createTimeStr":"2019-10-29 15:07:19","happenTime":1572332669000,"eventId":647392,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-08 15:07:19","supervisionType":"0","workFlowId":5053100,"createTime":1572332839000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21648404,"status":"03"},{"happenTimeStr":"2019-10-28 16:07:44","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡秀里村旱厕拆除","ROWNUM_":11,"instanceId":21618778,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡秀里村旱厕拆除","handleDate":1573114233000,"createTimeStr":"2019-10-28 16:10:34","happenTime":1572250064000,"eventId":646544,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-07 16:10:33","supervisionType":"0","workFlowId":5053100,"createTime":1572250234000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21618811,"status":"03"},{"happenTimeStr":"2019-10-28 16:04:39","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡肖军村环境整治","ROWNUM_":12,"instanceId":21618676,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡肖军村环境整治","handleDate":1573114169000,"createTimeStr":"2019-10-28 16:09:29","happenTime":1572249879000,"eventId":646541,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-07 16:09:29","supervisionType":"0","workFlowId":5053100,"createTime":1572250169000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21618709,"status":"03"},{"happenTimeStr":"2019-10-28 16:03:58","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡秀里村旱厕拆除测量","ROWNUM_":13,"instanceId":21618464,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡秀里村旱厕拆除测量","handleDate":1573113948000,"createTimeStr":"2019-10-28 16:05:48","happenTime":1572249838000,"eventId":646535,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-07 16:05:48","supervisionType":"0","workFlowId":5053100,"createTime":1572249948000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21618497,"status":"03"},{"happenTimeStr":"2019-10-28 16:01:26","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡秀里村旱厕拆除测量","ROWNUM_":14,"instanceId":21618392,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡秀里村旱厕拆除测量","handleDate":1573113916000,"createTimeStr":"2019-10-28 16:05:16","happenTime":1572249686000,"eventId":646533,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-07 16:05:16","supervisionType":"0","workFlowId":5053100,"createTime":1572249916000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21618425,"status":"03"},{"happenTimeStr":"2019-10-28 16:01:36","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡下洋坑村环境卫生整治","ROWNUM_":15,"instanceId":21618288,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡下洋坑村环境卫生整治","handleDate":1573113806000,"createTimeStr":"2019-10-28 16:03:26","happenTime":1572249696000,"eventId":646530,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-07 16:03:26","supervisionType":"0","workFlowId":5053100,"createTime":1572249806000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21618321,"status":"03"},{"happenTimeStr":"2019-10-28 16:00:00","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡下洋坑村环境卫生整治","ROWNUM_":16,"instanceId":21618252,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡下洋坑村环境卫生整治","handleDate":1573113770000,"createTimeStr":"2019-10-28 16:02:51","happenTime":1572249600000,"eventId":646529,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-07 16:02:50","supervisionType":"0","workFlowId":5053100,"createTime":1572249771000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21618285,"status":"03"},{"happenTimeStr":"2019-10-28 15:59:03","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡盘江村环境卫生整治","ROWNUM_":17,"instanceId":21618177,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡盘江村环境卫生整治","handleDate":1573113713000,"createTimeStr":"2019-10-28 16:01:53","happenTime":1572249543000,"eventId":646527,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-07 16:01:53","supervisionType":"0","workFlowId":5053100,"createTime":1572249713000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21618210,"status":"03"},{"happenTimeStr":"2019-10-28 15:58:14","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡均溪村环境卫生整治","ROWNUM_":18,"instanceId":21618112,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡均溪村环境卫生整治","handleDate":1573113663000,"createTimeStr":"2019-10-28 16:01:04","happenTime":1572249494000,"eventId":646525,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-07 16:01:03","supervisionType":"0","workFlowId":5053100,"createTime":1572249664000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21618145,"status":"03"},{"happenTimeStr":"2019-10-28 15:57:33","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡盘江村环境卫生整治","ROWNUM_":19,"instanceId":21618040,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡盘江村环境卫生整治","handleDate":1573113623000,"createTimeStr":"2019-10-28 16:00:23","happenTime":1572249453000,"eventId":646523,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-07 16:00:23","supervisionType":"0","workFlowId":5053100,"createTime":1572249623000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21618073,"status":"03"},{"happenTimeStr":"2019-10-28 15:57:50","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"其它","type":"310699","content":"盘亭乡南山村环境卫生整治","ROWNUM_":20,"instanceId":21618004,"handleDateFlag":"1","statusName":"结案待评","eventName":"盘亭乡南山村环境卫生整治","handleDate":1573113580000,"createTimeStr":"2019-10-28 15:59:40","happenTime":1572249470000,"eventId":646522,"eventClass":"环保-渣-其它","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-11-07 15:59:40","supervisionType":"0","workFlowId":5053100,"createTime":1572249580000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县盘亭乡","gridId":245481,"wfStatus":"1","taskId":21618037,"status":"03"}],"footer":null}

        //经办
        //{"total":2618,"rows":[{"happenTimeStr":"2017-04-26 14:59:09","bizPlatform":"0","urgencyDegreeName":"一般","typeName":"土地及资源权属纠纷","type":"5009","content":"2019年5月9日下午3点左右，富源村马公丘组村民李荣兴在马公丘岭下后门烧地勘，照成森林火灾，把同组村民蔡其祥的山场苗木烧毁，双方县赔偿问题产生纠纷。","ROWNUM_":1,"instanceId":21422590,"handleDateFlag":"1","statusName":"结束","eventName":"富源村李荣兴因烧地勘照成火灾的纠纷","handleDate":1572074678000,"createTimeStr":"2019-10-16 15:24:39","happenTime":1493189949000,"eventId":641435,"eventClass":"矛盾纠纷-土地及资源权属纠纷","urgencyDegree":"01","influenceDegree":"01","handleDateStr":"2019-10-26 15:24:38","supervisionType":"0","createTime":1571210679000,"influenceDegreeName":"小","gridPath":"福建省南平市浦城县九牧镇","gridId":246776,"status":"04"},{"happenTimeStr":"2019-03-13 10:43:15","eventId":384287,"eventClass":"环保-渣-乱丢弃医疗垃圾","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"乱丢弃医疗垃圾","influenceDegree":"01","type":"310602","content":"接网格员举报，我局执法人员到位于浦城县万安乡富湖村进行现场检查，现场检查时发现：发现倾倒点3处，均为河岸旁，该处位于浦城县大游水厂上游4公里，倾倒物均为过期药品，且倾倒点存在焚烧迹象，倾倒的过期药品中有福建省扬祖医药有限公司单据和塑料薄膜袋，据倾倒人陈滔介绍，该3处倾倒点的过期药品均来自福建省扬祖医药有限公司。在倾倒人陈滔的见证下，对倾倒现场情况进行拍照取证，并对倾倒点的倾倒物进行装袋清运，经有资质地磅称重，废气药品及焚毁残留物共计1440千克。。","ROWNUM_":2,"handleDateStr":"2019-04-12 10:45:41","supervisionType":"0","instanceId":13442327,"createTime":1554173142000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县","statusName":"结案待评","eventName":"扣押福建省扬祖医药公司非法倾倒医疗废物","handleDate":1555037141000,"gridId":8516,"createTimeStr":"2019-04-02 10:45:42","happenTime":1552444995000,"status":"03"},{"happenTimeStr":"2019-03-14 10:30:35","eventId":383961,"eventClass":"环保-其它","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"其它","influenceDegree":"01","type":"3199","content":"我局执法人员对浦城县忠信镇坑尾村进行现场检查时发现：在忠信镇坑尾村浦坑9号住宅后方约50米处建有一座熔炼设施，目前设置有熔炼炉1个，熔炼坩埚2个，发电机1台，鼓风机1台。现场检查时，熔炼炉正在建设。在该住宅业主廖章明见证下，对该熔炼设施现场情况进行拍照取证。对熔炼设施1座予以查封。","ROWNUM_":3,"handleDateStr":"2019-04-11 09:00:18","supervisionType":"0","instanceId":13431336,"createTime":1554080419000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县","statusName":"结案待评","eventName":"查封廖章明熔炼非法加工点","handleDate":1554944418000,"gridId":8516,"createTimeStr":"2019-04-01 09:00:19","happenTime":1552530635000,"status":"03"},{"happenTimeStr":"2018-12-18 09:43:50","eventId":367346,"eventClass":"矛盾纠纷-人格权纠纷","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"人格权纠纷","influenceDegree":"01","type":"5003","content":"于2018年12月3日进京上访，反映太平村村委会选举，村支书现场将选票撕毁，要求处理的上访事项。","ROWNUM_":4,"handleDateStr":"2019-01-26 09:53:58","supervisionType":"0","instanceId":12822632,"createTime":1547603640000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县仙阳镇太平村","statusName":"结束","eventName":"浦信来访[2018]347号","handleDate":1548467638000,"gridId":245550,"createTimeStr":"2019-01-16 09:54:00","happenTime":1545097430000,"status":"04"},{"happenTimeStr":"2018-12-15 09:28:45","eventId":367341,"eventClass":"矛盾纠纷-其他民商事纠纷","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"其他民商事纠纷","influenceDegree":"01","type":"5010","content":"于2018年12月15日到县上访，反映下洋村第七村民小组以你离婚为由，剥夺你享受人口田权利的上访事项。","ROWNUM_":5,"handleDateStr":"2019-01-26 09:42:59","supervisionType":"0","instanceId":12822433,"createTime":1547602981000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县仙阳镇下洋村","statusName":"结束","eventName":"浦信来访[2018]355号","handleDate":1548466979000,"gridId":245548,"createTimeStr":"2019-01-16 09:43:01","happenTime":1544837325000,"status":"04"},{"happenTimeStr":"2018-12-15 09:16:59","eventId":367330,"eventClass":"矛盾纠纷-土地及资源权属纠纷","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"土地及资源权属纠纷","influenceDegree":"01","type":"5009","content":"于2018年12月15日到县上访，反映林文荣是村霸，占道搭建，要求拆除违章建筑的问题。","ROWNUM_":6,"handleDateStr":"2019-01-26 09:27:47","supervisionType":"0","instanceId":12822034,"createTime":1547602069000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县仙阳镇三源村","statusName":"结束","eventName":"浦信来访[2018]372号","handleDate":1548466067000,"gridId":245552,"createTimeStr":"2019-01-16 09:27:49","happenTime":1544836619000,"status":"04"},{"happenTimeStr":"2018-11-13 16:23:13","eventId":353355,"eventClass":"环保-其它","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"其它","influenceDegree":"01","type":"3199","content":"2018年11月13日，接群众举报，我局执法人员到位于浦城县忠信镇金樟村安国寺电子元件加工点进行现场检查，现场检查时发现以下问题：未经相关部门审批，开办电子元件加工点，并处置废电路板等电子元件。根据《国家危险废物名录》，经认定，该电子元件为危险废物，危险废物类别为HW49，危险废物代码为900-045-49，危险废物特性为T（毒性）。依据《中华人民共和国刑法》第三百三十八条及《最高人民法院、最高人民检察院关于办理环境污染刑事案件适用法律若干问题的解释》（法释〔2016〕29号）第一条第二项“非法排放、倾倒、处置危险废物三吨以上的”，当事人的行为涉嫌环境污染犯罪。根据《中华人民共和国行政处罚法》第二十二条“ 违法行为构成犯罪的，行政机关必须将案件移送司法机关，依法追究刑事责任”和《行政执法机关移送涉嫌犯罪案件的规定》，将该案件移送公安机关调查处理。","ROWNUM_":7,"handleDateStr":"2018-12-10 15:28:17","supervisionType":"0","instanceId":12297098,"createTime":1543562898000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县","statusName":"结案待评","eventName":"查处忠信镇非法电子元件加工点","handleDate":1544426897000,"gridId":8516,"createTimeStr":"2018-11-30 15:28:18","happenTime":1542097393000,"status":"03"},{"happenTimeStr":"2018-10-17 15:17:46","eventId":353340,"eventClass":"环保-其它","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"其它","influenceDegree":"01","type":"3199","content":"2018年10月17日我局对福建闽鸿工贸有限公司进行日常检查，现场检查时，该公司生产线正在生产，现场检查发现以下环境问题：1、未办理环评审批手续，擅自开工建设粉末涂料生产线；2、磨粉、搅拌工段粉尘未配套建设收集处理设施，粉尘未经处理通过风机直排外环境。在该公司总经理颜希仁见证下，对粉末涂料生产情况进行拍照取证，并对该公司电力控制设施进行查封。","ROWNUM_":8,"handleDateStr":"2018-12-10 15:21:30","supervisionType":"0","instanceId":12296573,"createTime":1543562491000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县","statusName":"结案待评","eventName":"对未办理环评审批手续的生产线进行查封","handleDate":1544426490000,"gridId":8516,"createTimeStr":"2018-11-30 15:21:31","happenTime":1539760666000,"status":"03"},{"happenTimeStr":"2018-09-18 08:30:32","eventId":353328,"eventClass":"环保-其它","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"其它","influenceDegree":"01","type":"3199","content":"投诉人反映浦城县七里头加油站旁废品收购站影响周边环境。我局立即组织执法人员到现场进行检查，现场检查时发现，浦城县王桂财废品收购站于2009年11月25日注册工商营业执照（注册号350722600046835），在七里头村部斜对面（加油站旁）开办废品收购站，主要经营范围：生产性废旧金属、非生产性废旧金属、非金属再生资源的回收、销售（不含危废废弃物的回收），占地面积约1000多平方米。现场检查时，该公司正在经营废旧物品回收，现场背面堆放了约50个装色浆的废旧塑料空桶，空桶标识为福建华普新材料有限公司，单个重量约2Kg，16个装化工助剂的原料空桶，空桶标识为建德市顺发化工助剂有限公司，现场东面山边堆放了30余个装聚醚多元醇等油类物质的空铁桶；东北角堆放了20余个空铁桶。据向业主王桂财了解这批塑料空桶来源于荣华产皮革城，是十几天前拉来的，但不知具体为哪一家。在现场负责人王桂财见证下，对该回收站进行拍照、摄像取证。并对塑料空桶进行查封扣押。","ROWNUM_":9,"handleDateStr":"2018-12-10 15:17:17","supervisionType":"0","instanceId":12296151,"createTime":1543562237000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县","statusName":"结案待评","eventName":"查封浦城县王桂财废品收购站","handleDate":1544426237000,"gridId":8516,"createTimeStr":"2018-11-30 15:17:17","happenTime":1537230632000,"status":"03"},{"happenTimeStr":"2018-09-18 10:15:12","eventId":353323,"eventClass":"环保-其它","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"其它","influenceDegree":"01","type":"3199","content":"投诉人反映浦城县五里塘车管所对面有一所废旧物品回收点影响周边居民生活。我局立即组织执法人员对该点进行检查，现场检查时发现，浦城县方兴废旧物资经营部，类型是个体工商户，经营范围为生产性废旧金属、非生产性废旧金属、非金属再生资源的回收、销售（不含报废汽车及医疗废弃物、进口境外废弃物和危险废弃物的回收）。检查中发现存在以下问题：超经营范围回收化工桶，小桶六十余个，大桶三十余个。在该经营部负责人方德兴陪同下，进行拍照取证，并对化工桶进行查封。 ","ROWNUM_":10,"handleDateStr":"2018-12-10 15:13:08","supervisionType":"0","instanceId":12295928,"createTime":1543561989000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县","statusName":"结案待评","eventName":"查封浦城县方兴废旧物资经营部","handleDate":1544425988000,"gridId":8516,"createTimeStr":"2018-11-30 15:13:09","happenTime":1537236912000,"status":"03"},{"happenTimeStr":"2018-07-02 08:29:36","eventId":348855,"eventClass":"矛盾纠纷-劳动人事争议","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"劳动人事争议","influenceDegree":"01","type":"5007","content":"经了解，你已69岁，一生无生儿育女，只领养有一个女儿，已出嫁，由于女儿夫妇都是残疾人，是个享受低保待遇的贫困家庭，没有赡养父亲的能力。为此，经挂村领导与上洋村两委干部沟通后，目前，上洋村委会已在为你依法办理相关申报手续。","ROWNUM_":11,"handleDateStr":"2018-11-26 08:39:16","supervisionType":"0","instanceId":12136422,"createTime":1542328759000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县仙阳镇上洋村","statusName":"结束","eventName":"浦信来访[2018]157号","handleDate":1543192756000,"gridId":251101,"createTimeStr":"2018-11-16 08:39:19","happenTime":1530491376000,"status":"04"},{"happenTimeStr":"2018-04-23 10:38:50","eventId":348382,"eventClass":"矛盾纠纷-其他民商事纠纷","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"其他民商事纠纷","influenceDegree":"01","type":"5010","content":"黄达明属你入赘的孙女婿，管九村第15组不给你孙女婿一户享受该组村民待遇，要求解决。","ROWNUM_":12,"handleDateStr":"2018-11-24 10:49:40","supervisionType":"0","instanceId":12119042,"createTime":1542163782000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县仙阳镇管九村","statusName":"结束","eventName":"浦信来访[2018]99号","handleDate":1543027780000,"gridId":245547,"createTimeStr":"2018-11-14 10:49:42","happenTime":1524451130000,"status":"04"},{"happenTimeStr":"2018-06-28 11:05:07","eventId":348369,"eventClass":"矛盾纠纷-城乡建设发展纠纷","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"城乡建设发展纠纷","influenceDegree":"01","type":"5011","content":"忠信公路拓宽施工，将你耕种稻田灌溉水沟截断，造成无水耕种，要求解决。","ROWNUM_":13,"handleDateStr":"2018-11-24 11:13:49","supervisionType":"0","instanceId":12119369,"createTime":1542165231000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县仙阳镇管九村","statusName":"结束","eventName":"浦信来访[2018]156号","handleDate":1543029229000,"gridId":245547,"createTimeStr":"2018-11-14 11:13:51","happenTime":1530155107000,"status":"04"},{"happenTimeStr":"2018-05-18 10:50:06","eventId":348366,"eventClass":"矛盾纠纷-劳动人事争议","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"劳动人事争议","influenceDegree":"01","type":"5007","content":"黄达明属你入赘的孙女婿，管九村第15组不给你孙女婿一户享受该组村民待遇，要求解决。","ROWNUM_":14,"handleDateStr":"2018-11-24 11:04:22","supervisionType":"0","instanceId":12119264,"createTime":1542164663000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县仙阳镇三源村","statusName":"结束","eventName":"浦信来访","handleDate":1543028662000,"gridId":245552,"createTimeStr":"2018-11-14 11:04:23","happenTime":1526611806000,"status":"04"},{"happenTimeStr":"2018-11-14 10:31:04","eventId":348363,"eventClass":"矛盾纠纷-合同及相关纠纷","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"合同及相关纠纷","influenceDegree":"01","type":"5006","content":"向高洋村委会承包插花在百丈的“七树凹”山场，林权证办在百丈村，造成损失，要求解决。","ROWNUM_":15,"handleDateStr":"2018-11-24 10:38:19","supervisionType":"0","instanceId":12118819,"createTime":1542163100000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县仙阳镇高洋村","statusName":"结束","eventName":"浦信来访[2018]60号","handleDate":1543027099000,"gridId":251167,"createTimeStr":"2018-11-14 10:38:20","happenTime":1542162664000,"status":"04"},{"happenTimeStr":"2018-03-15 10:18:15","eventId":348358,"eventClass":"矛盾纠纷-城乡建设发展纠纷","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"城乡建设发展纠纷","influenceDegree":"01","type":"5011","content":"太平村十八里的房屋因205国道改线施工被挖裂，成为危房，要求解决。","ROWNUM_":16,"handleDateStr":"2018-11-24 10:30:37","supervisionType":"0","instanceId":12118539,"createTime":1542162639000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县仙阳镇太平村","statusName":"结束","eventName":"浦信来访[2018]47号","handleDate":1543026637000,"gridId":245550,"createTimeStr":"2018-11-14 10:30:39","happenTime":1521080295000,"status":"04"},{"happenTimeStr":"2018-01-29 09:41:04","eventId":348349,"eventClass":"矛盾纠纷-城乡建设发展纠纷","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"城乡建设发展纠纷","influenceDegree":"01","type":"5011","content":"反映2015年他们为仙阳便民中心做工，已完工工资至今未付，请求政府帮忙要回工资。","ROWNUM_":17,"handleDateStr":"2018-11-24 10:07:18","supervisionType":"0","instanceId":12117988,"createTime":1542161240000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县仙阳镇","statusName":"结束","eventName":"浦信来访[2018]21号","handleDate":1543025238000,"gridId":218176,"createTimeStr":"2018-11-14 10:07:20","happenTime":1517190064000,"status":"04"},{"happenTimeStr":"2018-01-29 10:07:55","eventId":348331,"eventClass":"矛盾纠纷-土地及资源权属纠纷","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"土地及资源权属纠纷","influenceDegree":"01","type":"5009","content":"反映邻居梅飞勇在你住房边通道上建一道围墙，影响你家的通道和排水，要求解决。","ROWNUM_":18,"handleDateStr":"2018-11-24 10:17:37","supervisionType":"0","instanceId":12118246,"createTime":1542161859000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县仙阳镇渔梁村","statusName":"结束","eventName":"浦信来访[2018]20号","handleDate":1543025857000,"gridId":245555,"createTimeStr":"2018-11-14 10:17:39","happenTime":1517191675000,"status":"04"},{"happenTimeStr":"2018-11-05 18:30:03","eventId":346635,"eventClass":"综治维稳-其他","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"其他","influenceDegree":"01","type":"0213","content":"马书记传达县委周永和书记关于扫黑除恶工作会议重要精神。","ROWNUM_":19,"handleDateStr":"2018-11-16 19:43:25","supervisionType":"0","instanceId":12057633,"createTime":1541504606000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县九牧镇","statusName":"结束","eventName":"九牧镇召开扫黑除恶督导整改工作推进会","handleDate":1542368605000,"gridId":246776,"createTimeStr":"2018-11-06 19:43:26","happenTime":1541413803000,"status":"04"},{"happenTimeStr":"2018-11-01 11:34:39","eventId":345678,"eventClass":"环保-水-企业外围偷排废水","urgencyDegreeName":"一般","urgencyDegree":"01","typeName":"企业外围偷排废水","influenceDegree":"01","type":"310310","content":"今日巡河至龙下自然村一组通往后洋大桥下河叉屏峰硫铁矿龙峰坑小溪有大量污水流入龙下河道，水体呈明湿黄色且有刺激性臭味","ROWNUM_":20,"handleDateStr":"2018-11-11 11:48:25","supervisionType":"0","instanceId":12024419,"createTime":1541044106000,"influenceDegreeName":"小","handleDateFlag":"1","gridPath":"福建省南平市浦城县永兴镇龙下村","statusName":"结束","eventName":"浦城和顺化工有限公司偷排废水","handleDate":1541908105000,"gridId":245543,"createTimeStr":"2018-11-01 11:48:26","happenTime":1541043279000,"status":"04"}],"footer":null}

        //
        JSONObject jsonObject = JSONObject.fromObject(response.body());
        int total = jsonObject.getInt("total");
        JSONArray items = jsonObject.getJSONArray("rows");
        List<Object> objs = Arrays.asList(items.toArray());
        List<ToDoVo> records = new ArrayList<>();
        for (Object o : objs) {
            JSONObject jsonObject1 = (JSONObject) o;
            ToDoVo toDoVo = (ToDoVo) JSONObject.toBean(jsonObject1, ToDoVo.class);
            records.add(toDoVo);
        }
        //boolean isOk = autoSave(header, param, total, eventType);
        boolean isOk = autoSave2(header, param, total, eventType);  //同步11  14 号之后
        if (isOk) {
            return Result.ok("全部保存");
        }
        return Result.error("保存少了");
    }


    private boolean autoSave(Map<String, String> header, Map<String, Object> param, int total, String eventType) {
        String url = "http://59.204.145.208:10001/zhsq_event/zhsq/event/eventDisposalController/listData.json";
        int page = total / 100 + 1;
        int size = 0;
        for (int i = 0; i < page; i++) {
            param.put("page", i + 1);
            param.put("rows", "100");
            HttpResponse response = HttpRequest.post(url).header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded").addHeaders(header).form(param).execute();
            JSONObject jsonObject = JSONObject.fromObject(response.body());
            JSONArray items = jsonObject.getJSONArray("rows");
            List<Object> objs = Arrays.asList(items.toArray());
            for (Object o : objs) {
                JSONObject jsonObject1 = (JSONObject) o;
                ToDoVo toDoVo = (ToDoVo) JSONObject.toBean(jsonObject1, ToDoVo.class);
                WgEvent wgEvent = new WgEvent();
                wgEvent.setId(UUIDGenerator.generate());
                BeanUtil.copyProperties(toDoVo, wgEvent);
                wgEvent.setRownum(toDoVo.getROWNUM_());
                wgEvent.setEventType(eventType);
                wgEventService.save(wgEvent);
                size++;
            }
        }
        if (size == total) {
            return true;
        } else {
            return false;
        }
    }

    private boolean autoSave2(Map<String, String> header, Map<String, Object> param, int total, String eventType) {
        String url = "http://59.204.145.208:10001/zhsq_event/zhsq/event/eventDisposalController/listData.json";
        int page = total / 100 + 1;
        int size = 0;
        for (int i = 0; i < page; i++) {
            param.put("page", i + 1);
            param.put("rows", "100");
            HttpResponse response = HttpRequest.post(url).header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded").addHeaders(header).form(param).execute();
            JSONObject jsonObject = JSONObject.fromObject(response.body());
            JSONArray items = jsonObject.getJSONArray("rows");
            List<Object> objs = Arrays.asList(items.toArray());
            for (Object o : objs) {
                JSONObject jsonObject1 = (JSONObject) o;
                ToDoVo toDoVo = (ToDoVo) JSONObject.toBean(jsonObject1, ToDoVo.class);
                WgEvent wgEvent = new WgEvent();
                wgEvent.setId(UUIDGenerator.generate());
                BeanUtil.copyProperties(toDoVo, wgEvent);
                LambdaQueryWrapper<WgEvent> qw = new LambdaQueryWrapper();
                qw.eq(WgEvent::getEventType, eventType);
                qw.eq(WgEvent::getEventId,wgEvent.getEventId());
                qw.eq(WgEvent::getInstanceId, wgEvent.getInstanceId());
                List<WgEvent> oldList = wgEventService.list(qw);
                if (oldList.size() > 0) {
                    WgEvent oldEvent = oldList.get(0);
                    BeanUtil.copyProperties(toDoVo, oldEvent);
                    oldEvent.setRownum(toDoVo.getROWNUM_());
                    oldEvent.setEventType(eventType);
                    wgEventService.updateById(oldEvent);
                } else {
                    wgEvent.setRownum(toDoVo.getROWNUM_());
                    wgEvent.setEventType(eventType);
                    wgEventService.save(wgEvent);
                }
                size++;
            }
        }
        if (size == total) {
            return true;
        } else {
            return false;
        }
    }


    //    @ApiOperation("各类事件受理情况")
    @RequestMapping(value = "/listDataA", method = RequestMethod.POST)
    public Result<?> listDataA(@RequestBody ListDataDto dto) {
        String url = "http://59.204.145.208:10001/zhsq_event/zhsq/event/eventOverviewController/listDataA.jhtml";
        Map<String, String> header = new HashMap<>();
        header.put("Accept", "application/json, text/javascript, */*; q=0.01");
        header.put("Accept-Encoding", "gzip, deflate");
        header.put("Accept-Language", "zh-CN,zh;q=0.9");
        header.put("Connection", "keep-alive");
        header.put("Content-Type", "application/x-www-form-urlencoded");
        header.put("Host", "59.204.145.208:10001");
        header.put("Origin", "http://59.204.145.208:10001");
        header.put("Cookie", dto.getCookie().toString());
        header.put("Referer", "http://59.204.145.208:10001/zhsq_event/zhsq/event/eventOverviewController/indexA.jhtml?system_privilege_action=4741");
        header.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36");
        header.put("X-Requested-With", "XMLHttpRequest");
        Map<String, Object> param = new HashMap<>();
        param.put("gridId", 8516);
        param.put("infoOrgCode", 350707);
        param.put("startTime", "2019-11-01");
        param.put("endTime", "2019-11-30");
        param.put(" bigTypes", "18,03,04,05,06,07,08,09,10,11,12,13,14,16,26,40,01,02,31,68,32,33,34,35,45,50,60,99");
        HttpResponse response = HttpRequest.post(url).header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded").addHeaders(header).form(param).execute();
        JSONObject jsonObject = JSONObject.fromObject(response.body());
        String path = "classpath:org/jeecg/modules/wangge/json/listDataA.json";
        try {
            PrintWriter pw = new PrintWriter(new BufferedOutputStream(new FileOutputStream(new File(path))));
            pw.print(jsonObject);
            pw.flush();
            pw.close();
        } catch (Exception e) {

        }
        //{"overview":{"SATISFY":13,"SYWBJ":714,"NO_SATISFY":0,"CJ":669,"BJ":668,"GQ":1,"TOTAL_SATISFY":13,"DUBAN":0,"TYPE_SATISFY":"00","WBJ":1,"VERY_SATISFY":0},"details":[{"CJ":9,"BJ":9,"TYPE_":"08"},{"CJ":9,"BJ":9,"TYPE_":"26"},{"CJ":1,"BJ":1,"TYPE_":"07"},{"CJ":650,"BJ":649,"TYPE_":"31"}],"mylDetails":[{"SATISFY":1,"NO_SATISFY":0,"TOTAL_SATISFY":1,"TYPE_SATISFY":"07","VERY_SATISFY":0},{"SATISFY":12,"NO_SATISFY":0,"TOTAL_SATISFY":12,"TYPE_SATISFY":"31","VERY_SATISFY":0}]}
        return Result.ok();
    }

    //@ApiOperation("获取事件详情detailEvent")
    @RequestMapping(value = "/detailEvent", method = RequestMethod.POST)
    public Result<?> detailEvent(@RequestBody ListDataDto dto) {
        String eventType = "";
        switch (dto.getType()) {
            case 1:
                eventType = "todo";  //待办事件
                break;
            case 2:
                eventType = "done";  //经办事件
                break;
            case 3:
                eventType = "history"; //归档事件
                break;
            case 4:
                eventType = "all";  // 辖区事件
                break;
            case 5:
                eventType = "my"; //我发起的
                break;
            default:
                eventType = "";
                break;
        }
        Map<String, String> header = new HashMap<>();
        header.put("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3");
        header.put("Accept-Encoding", "gzip, deflate");
        header.put("Accept-Language", "zh-CN,zh;q=0.9");
        header.put("Connection", "keep-alive");
        header.put("Content-Type", "application/x-www-form-urlencoded");
        header.put("Host", "59.204.145.208:10001");
        header.put("Origin", "http://59.204.145.208:10001");
        header.put("Cookie", dto.getCookie().toString());
        header.put("Referer", "http://59.204.145.208:10001/zhsq_event/zhsq/event/eventDisposalController/detailEvent.jhtml?");
        header.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36");
        header.put("Upgrade-Insecure-Requests", "1");
        String url = "http://59.204.145.208:10001/zhsq_event/zhsq/event/eventDisposalController/detailEvent.jhtml";
        LambdaQueryWrapper<WgEvent> queryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotBlank(eventType)) {
            queryWrapper.eq(WgEvent::getEventType,eventType);
        }
        //?eventType=history&instanceId=22262567&workFlowId=undefined&eventId=664580&model=c&cachenum=0.21862663272683713
        List<WgEvent> wgEventList = wgEventService.list(queryWrapper);
        for (WgEvent event:wgEventList) {
            Map<String, Object> param = new HashMap<>();
            param.put("eventType", event.getEventType());
            param.put("instanceId",event.getInstanceId());
            param.put("workFlowId","undefined");
            param.put("eventId",event.getEventId());
            param.put("cachenum",Math.random());
            HttpResponse response = HttpRequest.get(url).header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded").addHeaders(header).form(param).execute();
            int code = response.getStatus();
            if(code!=200){
                continue;
            }
            String html = response.body();
            String pre = "";
            String aft = "";
            if (StringUtils.isNotBlank(html)&& html.contains("<html>")) {
                 pre =  StringUtils.substringBetween(html,"<li style=\"word-break: break-all; width:97%; *width:94%;\">","<style type=\"text/css\">");
                 aft = StringUtils.substringBetween(html,"<div id=\"MetterMore\" class=\"ListShow ListShow2\" style=\"word-break: break-all; border: none;\">\n" +
                         "                            <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"line-height: 30px;\">","</table>");
            }
            if (StringUtils.isNotBlank(pre)){

            }
            if (StringUtils.isNotBlank(aft)){

            }
        }
//       }
        return Result.ok();
    }
    //@ApiOperation("获取事件详情")
    @RequestMapping(value = "/getList", method = RequestMethod.POST)
    public Result<?> getList(@RequestBody ListDataDto dto) {
        String eventType = "";
        switch (dto.getType()) {
            case 1:
                eventType = "todo";  //待办事件
                break;
            case 2:
                eventType = "done";  //经办事件
                break;
            case 3:
                eventType = "history"; //归档事件
                break;
            case 4:
                eventType = "all";  // 辖区事件
                break;
            case 5:
                eventType = "my"; //我发起的
                break;
            default:
                eventType = "";
                break;
        }
        Map<String, String> header = new HashMap<>();
        header.put("Accept", "application/json, text/javascript, */*; q=0.01");
        header.put("Accept-Encoding", "gzip, deflate");
        header.put("Accept-Language", "zh-CN,zh;q=0.9");
        header.put("Connection", "keep-alive");
        header.put("Content-Type", "application/x-www-form-urlencoded");
        header.put("Host", "59.204.145.208:10001");
        header.put("Origin", "http://59.204.145.208:10001");
        header.put("Cookie", dto.getCookie().toString());
        header.put("Referer", "http://59.204.145.208:10001/zhsq_event/zhsq/event/eventDisposalController/detailEvent.jhtml?");
        header.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36");
        header.put("X-Requested-With", "XMLHttpRequest");


        Map<String, String> header2 = new HashMap<>();
        header2.put("Accept", "image/webp,image/apng,image/*,*/*;q=0.8");
        header2.put("Accept-Encoding", "gzip, deflate");
        header2.put("Accept-Language", "zh-CN,zh;q=0.9");
        header2.put("Connection", "keep-alive");
        header2.put("Content-Type", "application/x-www-form-urlencoded");
        header2.put("Host", "59.204.145.208:10005");
        header2.put("Origin", "http://59.204.145.208:10001");
        header2.put("Cookie", dto.getCookie().toImgString());
        header2.put("Referer", "http://59.204.145.208:10001/zhsq_event/zhsq/event/eventDisposalController/detailEvent.jhtml?");
        header2.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36");
        header2.put("X-Requested-With", "XMLHttpRequest");
        String url = "http://59.204.145.208:10001/zhsq_event/zhsq/att/getList.jhtml";
        LambdaQueryWrapper<WgEvent> queryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotBlank(eventType)) {
            queryWrapper.eq(WgEvent::getEventType,eventType);
        }
        List<WgEvent> wgEventList = wgEventService.list(queryWrapper);
        for (WgEvent event:wgEventList) {
            if (event.getUpdateFlag() != null && event.getUpdateFlag() == 1){
                continue;
            }
            Map<String, Object> param = new HashMap<>();
            param.put("bizId", event.getEventId());
            param.put("attachmentType", "ZHSQ_EVENT");
            HttpResponse response = HttpRequest.post(url).header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded").addHeaders(header).form(param).execute();

            //[{"attachmentId":935909,"attachmentType":"ZHSQ_EVENT","bizId":660024,"title":"mmexport1574672511957.jpg","filePath":"/zzgrid/attachment/2019/11/25/zzgrid-attachment-973f3ae64150457ba71a6ce334252863.jpg","thumbnailPath":null,"thumbnailBase64":null,"fileName":"mmexport1574672511957.jpg","fileSize":"71757","downCount":null,"fileContent":null,"status":"001","imgWidth":"1080","imgHeight":"1440","eventSeq":"3","setTextVal":null,"attachmentOrder":null,"orgCode":null,"orgName":null,"creator":null,"createTime":1574672679000,"updator":null,"updateTime":null,"isValid":null,"remark":null,"creatorId":30039543,"creatorName":"李智鹏","createTimeStr":"2019-11-25 17:04:39","attId":null,"busCode":null,"busId":null,"attName":null,"attPath":null,"createUserId":null,"updateTimeStr":null,"updateUserId":null,"batchId":null,"attSize":null,"orderId":null}]
            List<Object> objs = null;
            try {
                JSONArray array = JSONArray.fromObject(response.body());
                objs = Arrays.asList(array.toArray());
            } catch (Exception e) {
                continue;
            }

            if (objs==null||objs.size() == 0){
                continue;
            }
            try {
                for (Object o : objs) {
                    JSONObject json = (JSONObject) o;
                    ArrListVo  arrListVo = (ArrListVo)JSONObject.toBean(json,ArrListVo.class);
                    if (arrListVo != null) {
                        String path = arrListVo.getFilePath();
                        if (StringUtils.isBlank(path)){
                            continue;
                        }
//                        LambdaQueryWrapper<WgEventFile> qw = new LambdaQueryWrapper<>();
//                        qw.eq(WgEventFile::getAttachmentId,arrListVo.getAttachmentId());
//                        qw.eq(WgEventFile::getFileName,arrListVo.getFileName());
//                        qw.eq(WgEventFile::getBizId,arrListVo.getBizId());
//                        if (wgEventFileService.list(qw).size()>0){
//                            continue;
//                        }
                        String url2 = "http://59.204.145.208:10005" + path+"?t="+ Math.random();
                        HttpResponse res = HttpRequest.get(url2).addHeaders(header2).form(param).execute();
                        InputStream in = res.bodyStream();
                        String dbpath = saveImage(in,arrListVo.getFileName());
                        if (StringUtils.isNotBlank(dbpath)){
                            WgEventFile eventFile = new WgEventFile();
                            eventFile.setFileName(arrListVo.getFileName());
                            eventFile.setAttachmentId(arrListVo.getAttachmentId());
                            eventFile.setAttachmentType(arrListVo.getAttachmentType());
                            eventFile.setBizId(arrListVo.getBizId());
                            eventFile.setFilePath(arrListVo.getFilePath());
                            eventFile.setCreatorId(arrListVo.getCreatorId());
                            eventFile.setCreatorName(arrListVo.getCreatorName());
                            eventFile.setNewFilePath(dbpath);
                            eventFile.setId(UUIDGenerator.generate());
                            eventFile.setEventSeq(arrListVo.getEventSeq());
                            eventFile.setImgHeight(arrListVo.getImgHeight());
                            eventFile.setImgWidth(arrListVo.getImgWidth());
                            eventFile.setTitle(arrListVo.getTitle());
                            //BeanUtil.copyProperties(arrListVo,eventFile);
                            boolean isOk = wgEventFileService.save(eventFile);
                            if (isOk && StringUtils.isNotBlank(eventFile.getId())){
                                if (StringUtils.isNotBlank(event.getEventFileIds())){
                                    event.setEventFileIds(event.getEventFileIds()+","+eventFile.getId());
                                } else {
                                    event.setEventFileIds(eventFile.getId());
                                }
                                event.setUpdateFlag(1);
                                wgEventService.updateById(event);
                            }
                        }
                    }
                }

            } catch (Exception e) {
                continue;
            }

        }
        return Result.ok();
    }


    private String saveImage(InputStream inputStream,String fileName) {
        OutputStream outputStream = null;
        try {
            String ctxPath = uploadpath;
            String bizPath = "files";
            String nowday = new SimpleDateFormat("yyyyMMdd").format(new Date());
            File file = new File(ctxPath + File.separator + bizPath + File.separator + nowday);
            if (!file.exists()) {
                file.mkdirs();// 创建文件根目录
            }
            String savePath = file.getPath() + File.separator + fileName;
            File savefile = new File(savePath);
            if (savefile.exists()){
                String dbpath = bizPath + File.separator + nowday + File.separator + fileName;
                if (dbpath.contains("\\")) {
                    dbpath = dbpath.replace("\\", "/");
                    return dbpath;

                }
            }
            outputStream = new FileOutputStream(savefile);
            FileCopyUtils.copy(inputStream,outputStream);
            String dbpath = bizPath + File.separator + nowday + File.separator + fileName;
            if (dbpath.contains("\\")) {
                dbpath = dbpath.replace("\\", "/");
                return dbpath;

            }
        } catch (IOException e) {

        } finally {
            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (IOException e) {
                    log.error(e.getMessage(), e);
                }
            }
            if (outputStream != null) {
                try {
                    outputStream.close();
                } catch (IOException e) {
                    log.error(e.getMessage(), e);
                }
            }
        }
        return null;
    }


}



    //http://59.204.145.208:10008//report2/gridEvent/getDataForOrgCount?orgCode=350707&startDate=2019-11-01&endDate=2019-11-30
//    orgCode: 350707
//    startDate: 2019-11-01
//    endDate: 2019-11-30

//    Accept: */*
//Accept-Encoding: gzip, deflate
//Accept-Language: zh-CN,zh;q=0.9
//Connection: keep-alive
//Content-Length: 0
//Cookie: loginName=nphuanght; loginPwd=Pchbj12369; Secure; remember=remember; UAM_SESSIONID=966DAF978F431D11EF75AE9329557F3D; UAM_TOKEN_FLAG=0; resourcekey="V6q72kt3G3uF1cB8pbKvg8rIo4k9n6FlCwKWlaBnQ7oClK+VAe91dZYokmCMJaPJ/ZlGwmK0TB9GMWPhmPMCZA=="; resource=MPIFDMlak4msTkC9jLOy7cIA3IubfmEyxqRRmhKP/1iSV5ulMCHLB49V8CZvq0bA; SYS_SESSIONID=BFCC68093AC39445D5E189D02E2A6726; JSESSIONID=CDA218FC24D448624869CE269ABFF166
//Host: 59.204.145.208:10008
//Origin: http://59.204.145.208:10008
//Referer: http://59.204.145.208:10008/report2/gridEvent/view?system_privilege_action=4280
//User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36
//X-Requested-With: XMLHttpRequest

//    {"names":["县直单位处理","街道（镇）处理","社区（村）自办"],"values":["0","0","668"]}


    //http://59.204.145.208:10008/report2/gridEvent/getEventNum
//    orgCode: 350707
//    startDate: 2019-11-01
//    endDate: 2019-11-30
//    eventType:

//    Accept: application/json, text/javascript, */*; q=0.01
//Accept-Encoding: gzip, deflate
//Accept-Language: zh-CN,zh;q=0.9
//Connection: keep-alive
//Content-Length: 65
//Content-Type: application/x-www-form-urlencoded; charset=UTF-8
//Cookie: loginName=nphuanght; loginPwd=Pchbj12369; Secure; remember=remember; UAM_SESSIONID=966DAF978F431D11EF75AE9329557F3D; UAM_TOKEN_FLAG=0; resourcekey="V6q72kt3G3uF1cB8pbKvg8rIo4k9n6FlCwKWlaBnQ7oClK+VAe91dZYokmCMJaPJ/ZlGwmK0TB9GMWPhmPMCZA=="; resource=MPIFDMlak4msTkC9jLOy7cIA3IubfmEyxqRRmhKP/1iSV5ulMCHLB49V8CZvq0bA; SYS_SESSIONID=BFCC68093AC39445D5E189D02E2A6726; JSESSIONID=CDA218FC24D448624869CE269ABFF166
//Host: 59.204.145.208:10008
//Origin: http://59.204.145.208:10008
//Referer: http://59.204.145.208:10008/report2/gridEvent/view?system_privilege_action=4280
//User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36
//X-Requested-With: XMLHttpRequest

    //{"status":0,"message":null,"data":{"total":669,"codeArray":["350707001","350707002","350707003","350707004","350707005","350707006","350707007","350707008","350707009","350707010","350707011","350707012","350707013","350707014","350707015","350707016","350707017","350707018","350707019","350707020"],"valueArray":[0,0,9,0,0,0,2,0,628,2,0,24,0,0,0,0,0,2,0,2],"gridIdArray":["212000","211946","246776","218176","240019","240027","241747","244182","244183","244181","245435","245446","245481","245519","245530","245560","245570","246147","246267","246293"],"nameArray":["河滨街道","南浦街道","九牧镇","仙阳镇","万安乡","水北镇","石陂镇","濠村乡","官路乡","山下乡","枫溪乡","水北街镇","盘亭乡","管厝乡","永兴镇","古楼乡","莲塘镇","富岭镇","临江镇","忠信镇"]}}

//http://59.204.145.208:10008/report2/gridEvent/getEventType
    //{"status":0,"message":null,"data":{"codeArray":["18","03","04","05","06","07","08","09","10","11","12","13","14","16","26","40","01","02","31","68","32","33","34","35","45","50","60","99"],"valueArray":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"nameArray":["随手拍事件","计生","劳保","民政","安全工作","城市管理","农林水","文明创建","宣传教育","人民武装","经济服务","便民服务","群团工作","车辆违章","施工环境保障","旅游服务","党建","综治维稳","环保","扫黑除恶专项斗争","市场监管","涉茶事件","道安事件","铁路安全","食药监","矛盾纠纷","城市管理（数字城管）","其他"]}}

//http://59.204.145.208:10008/report2/gridEvent/getComplete
    //{"status":0,"message":null,"data":{"total":0,"complete":0}}

